﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WPFSchematics.Definition.Entities;
using WPFSchematics.Definition.Common;
using WPFSchematics.Definition.Templates;
using WPFSchematics.Definition.Shapes;

namespace WPFSchematics.Definition.Layers
{
    /// <summary>
    /// 图元提供者图层接口。
    /// </summary>
    public interface IShapeProviderLayer :IEntity,IShapeState          
    {
        /// <summary>
        /// 父图层。
        /// </summary>
        IShapeProviderLayer ParentLayer { set; get; }
    }
    
    /// <summary>
    /// 比例范围。
    /// </summary>
    public class ControlRange
    {

        private double _lowValue = double.MinValue;

        /// <summary>
        /// 控制下线。
        /// </summary>
        public double LowValue
        {
            get { return _lowValue; }
        }

        private double _highValue = double.MaxValue;

        /// <summary>
        /// 控制下限。
        /// </summary>
        public double HighValue
        {
            get { return _highValue; }
        }

        /// <summary>
        /// 构造。
        /// </summary>
        /// <param name="lowValue">控制下线。</param>
        /// <param name="highValue">控制上线。</param>
        public ControlRange(double lowValue, double highValue)
        {
            if (lowValue < highValue)
            {
                _lowValue = lowValue;
                _highValue = highValue;
            }
            else
            {
                _lowValue = highValue;
                _highValue = lowValue;
            }
        }
    }

    /// <summary>
    /// 缩放模式。
    /// </summary>
    public enum ScaleMode
    {
        /// <summary>
        /// 点缩放。缩放时，仅变换图元位置，图元本身不改变。
        /// </summary>
        Point,
        /// <summary>
        /// 几何缩放。缩放时，变换图元的位置和轮廓，图元边界线宽不变。
        /// </summary>
        Area,
        /// <summary>
        /// 全缩放。缩放时，变换图元的位置、形状、和边界线宽。
        /// </summary>
        All,
    }
}
